<?
/**
 * LangEngineBuilder
 * @author King Beto <apardo@adverit.com>
 * @copyright  2005 - AdVerit S.A. <www.adverit.com>
 * @version 1.0
 * @package database
 * @update     04/09/2009 07:02:24 p.m.
 */

class LangEngineBuilder
{
    public function &build($options)
    {
        switch(strtolower($options['type']))
        {
            case "mysql":
                $engine = new LangEngineMysql();
                $engine->setDBLink($options['dbLink']);
                break;
            case "txt":
                $engine = new LangEngineTxt();
                $engine->setSaveFilename($options['saveFile']);
                foreach($options['loadFiles'] AS $file)
                {
                    $engine->load($file);
                }
                break;
            default: die("Please set lang engine type.");
        }
        return $engine;
    }
}

?>